from django.contrib.flatpages.models import *
class Formulario(models.Model) :
    ip = models.IPAddressField()
    data = models.DatTimeField()
    comentarios = models.CharField(max_length=2000, blank=True,null=True )

    def __unicode__(self):
        return u""


class Secao(models.Model) :
    nome = models.CharField(max_length=30)
    pagina = models.ForeignKey(FlatPage,null=True)
    url = models.CharField(max_length=100, null=True )

    def __unicode__(self):
        return u""


class InteresesVisita(models.Model) :
    nome = models.CharField(max_length=100)

    def __unicode__(self):
        return u""


class Formulario1(Formulario) :
    nomepessoa = models.CharField(max_length=150)
    emailpessoa = models.EmailField()
    cargo = models.CharField(max_length=100)
    telefone = models.CharField(max_length=200)
    endereco = models.CharField(max_length=300)
    fax = models.CharField(max_length=200, null=True,blank=True )
    pagina = models.CharField(max_length=300, null=True,blank=True )

    def __unicode__(self):
        return u""


class Formulario2(Formulario) :
    nomepessoa = models.CharField(max_length=150)
    emailpessoa = models.EmailField()
    cargo = models.CharField(max_length=100)
    telefone = models.CharField(max_length=200)
    fax = models.CharField(max_length=200, null=True,blank=True )
    endereco = models.CharField(max_length=200, null=True,blank=True )
    pagina = models.CharField(max_length=300, null=True,blank=True )
    intereses = models.ManyToManyField(InteresesVisita)

    def __unicode__(self):
        return u""


class Formulario3(Formulario) :
    nome = models.CharField(max_length=100)
    grau = models.IntegerField()
    telefone = models.CharField(max_length=150)
    endereco = models.CharField(max_length=150)
    email = models.EmailField(null=True,blank=True)

    def __unicode__(self):
        return u""


class Caixa(models.Model) :
    pos = models.IntegerField()
    nome = models.CharField(max_length=30)
    secao = models.ForeignKey(Secao)
    pagina = models.ForeignKey(FlatPage,null=True)
    url = models.CharField(max_length=100, null=True )

    def __unicode__(self):
        return u""


class link(models.Model) :
    nome = models.CharField(max_length=30)
    caixa = models.ForeignKey(Caixa)
    pagina = models.ForeignKey(FlatPage,null=True)
    url = models.CharField(max_length=100, null=True )

    def __unicode__(self):
        return u""

